home *** CD-ROM | disk | FTP | other *** search
/ The Utilities Experience / The Utilities Experience - Volume 1.iso / software / comms / thor_2.22 / thor.lha / rexx / CfgFIDO.thor < prev    next >
Text File  |  1995-12-18  |  5KB  |  121 lines

  1. /* $VER: CfgFIDO.thor 1.4 (11.12.95)
  2.  *
  3.  * External configuration for the FIDO bbstype.
  4.  *
  5.  * Script by: Magne Østlyngen, Ultima Thule Software.
  6.  */
  7.  
  8. parse arg argument
  9. options results
  10.  
  11. template = 'BBSNAME/A,CONFNAME/K,PUBSCREEN/K'
  12.  
  13. p=address()||' '||show('P',,);if pos('THOR.',p)>0 then thorport=word(,
  14. substr(p,pos('THOR.',p)),1);else do;say 'No THOR port found!';exit 10;end
  15.  
  16. if ~show('p', 'BBSREAD') then do
  17.     address command
  18.         "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead"
  19.         "WaitForPort BBSREAD"
  20. end
  21.  
  22. address "BBSREAD"
  23.  
  24. READARGS template ARGS CMDLINE argument
  25. if rc ~= 0 then do
  26.     address(thorport)
  27.     REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  28.     exit 5
  29. end
  30.  
  31. GETBBSDATA bbsname '"'ARGS.BBSNAME'"' stem BBSDATA
  32. if rc ~= 0 then do
  33.     address(thorport)
  34.     REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"'
  35.     exit 5
  36. end
  37.  
  38. address(thorport)
  39.  
  40. origin = ""
  41. uucpaddr = ""
  42. uucpname = ""
  43. password = ""
  44. forceintl = "NO"
  45. packnetmail = "NO"
  46. afname = ""
  47. afpasswd = ""
  48. showorigin = "NO"
  49.  
  50. if open(fil, BBSDATA.BBSPATH||'fido.config', R) then do
  51.     do while ~eof(fil)
  52.         ln = readln(fil)
  53.         if upper(word(ln, 1)) = "ORIGIN:" then origin = strip(delstr(ln, 1, 7))
  54.         if upper(word(ln, 1)) = "PASSWORD:" then password = strip(delstr(ln, 1, 9))
  55.         if upper(word(ln, 1)) = "FORCEINTL:" then forceintl = strip(delstr(ln, 1, 10))
  56.         if upper(word(ln, 1)) = "PACKNETMAIL:" then packnetmail = strip(delstr(ln, 1, 12))
  57.         if upper(word(ln, 1)) = "UUCPADDRESS:" then uucpaddr = strip(delstr(ln, 1, 12))
  58.         if upper(word(ln, 1)) = "UUCPNAME:" then uucpname = strip(delstr(ln, 1, 9))
  59.         if upper(word(ln, 1)) = "AREAFIXNAME:" then afname = strip(delstr(ln, 1, 12))
  60.         if upper(word(ln, 1)) = "AREAFIXPASSWORD:" then afpasswd = strip(delstr(ln, 1, 16))
  61.         if upper(word(ln, 1)) = "SHOWORIGIN:" then showorigin = strip(delstr(ln, 1, 11))
  62.     end
  63.     call close(fil)
  64. end
  65.  
  66. if forceintl ~= "YES" & forceintl ~= "NO" then do
  67.     REQUESTNOTIFY TEXT '"Error in config: FORCEINTL neither YES nor NO.\n"' BT '"_Ok"'
  68. end
  69.  
  70. REQUESTSTRING TITLE '"Enter Origin:"' BODY '"The origin line is on the format:\n\n ** Origin <text> (<address>)\n\nWhere <text> is this text, and <address> is your fido-address."' BT '"_Ok|_Abort"' ID '"'||origin||'"' MAXCHARS 256
  71. if rc=30 then exit 10
  72. if rc=0 then origin = result
  73.  
  74. REQUESTNOTIFY TEXT '"Show origin lines?\n\nIf you enable this option, origin lines are added to\nthe message body.  If this option is disabled, the\norigin lines are added to the comment-text."' BT '"_Yes|_No"'
  75. if rc~=0 then exit 10
  76. if result = 1 then showorigin = "YES"; else showorigin = "NO"
  77.  
  78. REQUESTSTRING TITLE '"Enter Password:"' BODY '"This is the password that is\nput into the reply-packets\n(NOT the password in areafix messages!)"' BT '"_Ok|_Abort"' ID '"'||password||'"' MAXCHARS 8
  79. if rc=30 then exit 10
  80. if rc=0 then password = result
  81.  
  82. REQUESTNOTIFY TEXT '"Force INTL lines?\n\nIf you experience problems with your netmail\nnot coming to the receiver, try setting \nthis to yes."' BT '"_Yes|_No"'
  83. if rc~=0 then exit 10
  84. if result = 1 then forceintl = "YES"; else forceintl = "NO"
  85.  
  86. REQUESTNOTIFY TEXT '"Pack netmail?\n\nShould messages written in NetMail.#? also be archived?"' BT '"_Yes|_No"'
  87. if rc~=0 then exit 10
  88. if result = 1 then packnetmail = "YES"; else packnetmail = "NO"
  89.  
  90. REQUESTSTRING TITLE '"Enter UUCP address:"' BODY '"This is the address of the gateway to send internet messages through"' BT '"_Ok|_Abort"' ID '"'||uucpaddr||'"' MAXCHARS 256
  91. if rc=30 then exit 10
  92. if rc=0 then uucpaddr = result
  93.  
  94. REQUESTSTRING TITLE '"Enter UUCP name:"' BODY '"This is the name of the UUCP gateway"' BT '"_Ok|_Abort"' ID '"'||uucpname||'"' MAXCHARS 256
  95. if rc=30 then exit 10
  96. if rc=0 then uucpname = result
  97.  
  98. REQUESTSTRING TITLE '"Enter areafix name:"' BODY '"This is the name of Areafix\nDefault is '||"'"||'areafix'||"'"||'"' BT '"_Ok|_Abort"' ID '"'||afname||'"' MAXCHARS 70
  99. if rc=30 then exit 10
  100. if rc=0 then afname = result
  101.  
  102. REQUESTSTRING TITLE '"Enter areafix password:"' BODY '"This is the password to put in areafix messages"' BT '"_Ok|_Abort"' ID '"'||afpasswd||'"' MAXCHARS 31
  103. if rc=30 then exit 10
  104. if rc=0 then afpasswd = result
  105.  
  106.  
  107. if open(fil, BBSDATA.BBSPATH||'fido.config', W) then do
  108.     if origin ~= "" then call writeln(fil, "ORIGIN: "||origin)
  109.     if password ~= "" then call writeln(fil, "PASSWORD: "||password)
  110.     if forceintl ~= "NO" then call writeln(fil, "FORCEINTL: "||forceintl)
  111.     if showorigin ~= "NO" then call writeln(fil, "SHOWORIGIN: "||showorigin)
  112.     if packnetmail ~= "NO" then call writeln(fil, "PACKNETMAIL: "||packnetmail)
  113.     if uucpaddr ~= "" then call writeln(fil, "UUCPADDRESS: "||uucpaddr)
  114.     if uucpname ~= "" then call writeln(fil, "UUCPNAME: "||uucpname)
  115.     if afname ~= "" then call writeln(fil, "AREAFIXNAME: "||afname)
  116.     if afpasswd ~= "" then call writeln(fil, "AREAFIXPASSWORD: "||afpasswd)
  117.     call close(fil)
  118. end
  119.  
  120. exit 0
  121.